package com.abc.http.example.simple;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.abc.http.example.common.model.HttpResult;
import com.abc.http.example.common.model.User;

/**
 * @description: 简单集成控制器
 * @author: yansl.cn
 * @create: 2023-01-16 17:17
 */
@RestController
@RequestMapping("simple")
public class SimpleController {
    @Autowired
    private SimpleAPI simpleAPI;

    @RequestMapping("get")
    public HttpResult get(String name) {
        return simpleAPI.get(name);
    }

    @RequestMapping("getByUser")
    public HttpResult getByUser() {
        return simpleAPI.getByUser();
    }

    @RequestMapping("list")
    public HttpResult list() {
        return simpleAPI.list();
    }

    @RequestMapping("create")
    public HttpResult create() {
        return simpleAPI.createUser(new User("调用API", 10));
    }

}
